#ifndef COMMONUI_GFX_SIZE_H_
#define COMMONUI_GFX_SIZE_H_
#pragma once

#include "../concise-ui.h"

namespace gfx {

class CONCISEUI_API Size
{
public:
	Size(void);
	Size(int width, int height);
	Size(const Size& size);
	~Size(void);

	int Width() const { return width_; }
	int Height() const { return height_; }
	void SetWidth(int width);
	void SetHeight(int height);

	int GetArea() const { return width_ * height_; }
	
	void SetSize(int width, int height)
	{
		SetWidth(width);
		SetHeight(height);
	}

	void Enlarge(int delta_width, int delta_height)
	{
		SetWidth(width_ + delta_width);
		SetHeight(height_ + delta_height);
	}

	bool IsEmpty() const
	{
		return width_ == 0 || height_ == 0;
	}

	Size& operator= (const Size& rhs);
	bool operator== (const Size& rhs) const;
	bool operator!= (const Size& rhs) const;

private:
	int width_;
	int height_;
};

} // namespace gfx

#endif // COMMONUI_GFX_SIZE_H_